Defunctionalized Interpreters for Call-by-Need Evaluation

نویسندگان

  • Olivier Danvy
  • Kevin Millikin
  • Johan Munk
  • Ian Zerny
چکیده

Starting from the standard call-by-need reduction for the λ-calculus that is common to Ariola, Felleisen, Maraist, Odersky, and Wadler, we inter-derive a series of hygienic semantic artifacts: a reductionfree stateless abstract machine, a continuation-passing evaluation function, and what appears to be the first heapless natural semantics for call-by-need evaluation. Furthermore we observe that a data structure and a judgment in this natural semantics are in defunctionalized form. The refunctionalized counterpart of this evaluation function is an extended direct semantics in the sense of Cartwright and Felleisen. Overall, the semantic artifacts presented here are simpler than many other such artifacts that have been independently worked out, and which require ingenuity, skill, and independent soundness proofs on a caseby-case basis. They are also simpler to inter-derive because the interderivational tools (e.g., refocusing and defunctionalization) already exist.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

On inter-deriving small-step and big-step semantics: A case study for storeless call-by-need evaluation

Starting from the standard call-by-need reduction for the λ-calculus that is common to Ariola, Felleisen, Maraist, Odersky, and Wadler, we inter-derive a series of hygienic semantic artifacts: a reduction-free storeless abstract machine, a continuation-passing evaluation function, and what appears to be the first heapless natural semantics for callby-need evaluation. Furthermore we observe that...

متن کامل

Maximal Laziness: An Efficient Interpretation Technique for Purely Functional DSLs

In lazy functional languages, any variable is evaluated at most once. This paper proposes the notion of maximal laziness, in which syntactically equal terms are evaluated at most once: if two terms e1 and e2 arising during the evaluation of a program have the same abstract syntax representation, then only one will be evaluated, while the other will reuse the former’s evaluation result. Maximal ...

متن کامل

On Evaluation Contexts, Continuations, and the Rest of the Computation

Continuations are variously understood as representations of the current evaluation context and as representations of the rest of the computation, but these understandings contradict each other: plugging an expression in a context yields a new expression whereas sending an intermediate result to a continuation yields the final answer. We show that continuations-as-evaluation-contexts are the de...

متن کامل

Explaining the lazy Krivine machine using explicit substitution and addresses

In a previous paper, Benaissa, Lescanne, and Rose, have extended the weak lambda-calculus of explicit substitution λσw with addresses, so that it gives an account of the sharing implemented by lazy functional language interpreters. We show in this paper that their calculus, called λσ w, fits well to the lazy Krivine machine, which describes the core of a lazy (call-by-need) functional programmi...

متن کامل

H-CFA: a Simplified Approach for Pushdown Control Flow Analysis

H -CFA: A SIMPLIFIED APPROACH FOR PUSHDOWN CONTROL FLOW ANALYSIS by Fei Peng The University of Wisconsin-Milwaukee, 2016 Under the Supervision of Professor Tian Zhao In control flow analysis (CFA), call/return mismatch is a problem that reduces analysis precision. So-called k -CFA uses bounded call-strings to obtain limited call/return matching, but it has a serious performance problem due to i...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010